NAMESPACE?=ingress-nginx

add_repo:
	helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
	helm repo update

pull_repo:
	helm pull ingress-nginx/ingress-nginx --version 4.9.1
	tar -zxf ingress-nginx-4.9.1.tgz

install:
	-kubectl create ns ingress-nginx
	helm upgrade --install -f ./charts/ingress-nginx/values.yaml ingress-nginx ./charts/ingress-nginx -n $(NAMESPACE)
	-kubectl create clusterrole configmap-manage --verb=get,list,watch,create,patch,update --resource=configmaps
	kubectl create rolebinding ingress-confingmap-binding --clusterrole=configmap-manage --serviceaccount=ingress-nginx:ingress-nginx

uninstall:
	helm uninstall ingress-nginx -n $(NAMESPACE)
	kubectl delete ns $(NAMESPACE)


